This is necessary to be sure that the shadow mode code can always detect
writes to guest page tables.
This should fix Windows restore from hibernation on SVM platforms.
Signed-off-by: Tom Woller <thomas.woller@amd.com>
/* We don't want to lose PG. ET is reserved and should be always be 1*/
paging_enabled = svm_paging_enabled(v);
value |= X86_CR0_ET;
- vmcb->cr0 = value | X86_CR0_PG;
+ vmcb->cr0 = value | X86_CR0_PG | X86_CR0_WP;
v->arch.hvm_svm.cpu_shadow_cr0 = value;
/* TS cleared? Then initialise FPU now. */
vmcb->tsc_offset = 0;
/* VMCB State */
- vmcb->cr0 = X86_CR0_ET | X86_CR0_PG;
+ vmcb->cr0 = X86_CR0_ET | X86_CR0_PG | X86_CR0_WP;
v->arch.hvm_svm.cpu_shadow_cr0 = X86_CR0_ET;
vmcb->cr2 = 0;
/* Guest CR0. */
vmcb->cr0 = read_cr0();
arch_svm->cpu_shadow_cr0 = vmcb->cr0 & ~(X86_CR0_PG | X86_CR0_TS);
+ vmcb->cr0 |= X86_CR0_WP;
/* Guest CR4. */
arch_svm->cpu_shadow_cr4 =